const option = {
  titl: 'title',
  // legend: {},
  grid: {
    show: true,
    left: "60px",
    top: "20px",
    right: "60px",
    bottom: "40px"
  },
  tooltip: {
    trigger: 'axis',
    formatter (params) {
      let listHtml = ``
      for (let i = 0; i < params.length; i++) {
        if (params[i].seriesName !== 'k线') {
          listHtml += `<div style="display:flex;justify-content: space-between;">
                      <span>${params[i].seriesName}：</span>
                      <span>${(params[i].value).toFixed(2)}</span>
                    </div>`
        } else {
          listHtml += `
          <div style="display:flex;justify-content: space-between;">
            <span>k线(开)：</span>
            <span>${params[i].value[1].toFixed(2)}</span>
          </div>
          <div style="display:flex;justify-content: space-between;">
            <span>k线(收)：</span>
            <span>${params[i].value[2].toFixed(2)}</span>
          </div>
          <div style="display:flex;justify-content: space-between;">
            <span>k线(低)：</span>
            <span>${params[i].value[3].toFixed(2)}</span>
          </div>
          <div style="display:flex;justify-content: space-between;">
            <span>k线(高)：</span>
            <span>${params[i].value[4].toFixed(2)}</span>
          </div>
          `
        }
      }
      let html = `<div style="width:200px">
                    <div style="display:flex;justify-content: space-between;">
                      <span>日期：</span>
                      <span>${params[0].axisValue}</span>
                    </div>
                    ${listHtml}
                  </div>`
      return html
    }
  },
  xAxis: {
    type: 'category',
    // boundaryGap: false,
    data: []
  },
  yAxis: {
    min: 'dataMin'
  },
  // dataZoom: [{
  //   type: 'inside',
  //   start: 0,
  //   end: 100
  // },
  // {
  //   start: 0,
  //   end: 100
  // }],
  dataZoom: [{
    type: 'inside',
    xAxisIndex: [0, 0],
    start: 0,
    end: 100
  }],
  series: []
}
export { option }